<template>
  <div>
    <el-form-item
      v-if="type === 'EXPORT'"
      label="填写规则:"
      prop="displayRule"
      :rules="[
        {
          required: true,
          message: '请选择规则',
          trigger: 'change',
        },
      ]"
    >
      <LabelExpression
        style="width: 500px"
        v-model="value.displayRule"
        :fields="staffDisplayRuleField"
      />
    </el-form-item>
    <el-form-item v-if="type === 'IMPORT'" label="人员字段填写格式:">
      <div>1.如果姓名不重复，直接输入姓名，如：“山竹”；</div>
      <div>2.如果重名，则在前面加上账号，如："[05191]张三"、“【0519】李四”</div>
    </el-form-item>
  </div>
</template>
<script>
import LabelExpression from "@/components/LabelExpression";
//人员选择字段
const staffDisplayRuleField = [
  { label: "ID", value: "id" },
  { label: "账号", value: "username" },
  { label: "用户名", value: "name" },
  { label: "工号", value: "jobNumber" },
  { label: "邮箱", value: "email" },
  { label: "电话", value: "mobile" },
  { label: "英文名", value: "englishName" },
];
export default {
  name: "StaffConfig",
  props: {
    value: {
      type: Object,
      default: () => {
        return {};
      },
    },
    type: {
      type: String,
      default: "",
    },
  },
  components: {
    LabelExpression,
  },
  data() {
    return {
      staffDisplayRuleField,
    };
  },
  methods: {},
};
</script>